#include<iostream>
using namespace std;

int main()              //输入一个整数，判断是否能同时被3、5和7整除
{
    int x;
    cin >> x;
    if(x%3==0 && x%5==0 && x%7==0)
    {
        cout << "3 5 7" << endl;
    }
    else if(x%3==0 && x%5==0 &&x%7!=0)
    {
        cout << "3 5" << endl;
    }
    else if(x%3==0 && x%7==0 && x%5!=0)
    {
        cout << "3 7" << endl;
    }
    else if(x%5==0 && x%7==0 && x%3!=0)
    {
        cout << "5 7" << endl;
    }
    else if(x%3==0 && x%5!=0 && x%7!=0)
    {
        cout << "3" << endl;
    }
    else if(x%5==0 && x%3!=0 && x%7!=0)
    {
        cout << "5" << endl;
    }
    else if(x%7==0 && x%3!=0 && x%5!=0)
    {
        cout << "7" << endl;
    }
    else
    {
        cout << "n" << endl;
    }
    return 0;
}